f = open("yesterday","r", encoding="utf-8")
f_new = open("yesterday2","w+",encoding="utf-8")

for line in f:
    if "我爱" in line:
        line = line.replace("我爱","I love2")
    f_new.write(line)

f.close()
f_new.close()